/*commented gen files are reminders of how variables were created*/

/*change path as necessary*/
use "C:Preaching to the Choir\Stata files\Dataverse files\Data2017survey.dta"

eststo clear

/* belief variables: Likert 1-5, lower number means agree more that waste causes problem; choir sample if <=2
*/

/* belief variables: Likert 1-5, lower number means agree more that waste causes problem
so variables are reverse coded:
gen ch_nature_r = ch_nature * -1
gen ch_litter_r = ch_litter * -1
gen ch_energy_r = ch_energy * -1
gen ch_landfills_r = ch_landfills * -1
gen nature_pre_r = nature_pre * -1
gen litter_pre_r = litter_pre * -1
gen energy_pre_r = energy_pre * -1
gen landfills_pre_r = landfills_pre * -1
gen nature_post_r = nature_post * -1
gen litter_post_r = litter_post * -1
gen energy_post_r = energy_post * -1
gen landfills_post_r = landfills_post * -1
*/

constraint 1 nature_pre_r = 1
tobit nature_post_r nature_pre_r video text if nature_pre_r>=-2, nocon ul ll constraints(1)
eststo naturetc,title ("Reducing waste is a major way to conserve natural resources") 
tobit nature_post_r nature_pre_r video text if nature_pre_r<-2, nocon ul ll constraints(1)
eststo naturetn,title ("Reducing waste is a major way to conserve natural resources") 

constraint 2 litter_pre_r = 1
tobit litter_post_r litter_pre_r video text if litter_pre_r >=-2, nocon ul ll constraints(2)
eststo littertc, title ("Reducing waste is a major way to reduce litter") 
tobit litter_post_r litter_pre_r video text if litter_pre_r <-2, nocon ul ll constraints(2)
eststo littertn, title ("Reducing waste is a major way to reduce litter") 

constraint 3 energy_pre_r = 1
tobit energy_post_r energy_pre_r video text if energy_pre_r >=-2, nocon ul ll constraints(3)
eststo energytc,title ("Reducing waste is a major way to conserve energy") 
tobit energy_post_r energy_pre_r video text if energy_pre_r <-2, nocon ul ll constraints(3)
eststo energytn,title ("Reducing waste is a major way to conserve energy") 

constraint 4 landfills_pre_r = 1
tobit landfills_post_r landfills_pre_r video text if landfills_pre_r >=-2, nocon ul ll constraints(4)
eststo landfillstc, title ("Reducing waste is a major way to reduce landfills") 
tobit landfills_post_r landfills_pre_r video text if landfills_pre_r <-2, nocon ul ll constraints(4)
eststo landfillstn, title ("Reducing waste is a major way to reduce landfills")

esttab naturetc naturetn littertc littertn energytc energytn landfillstc landfillstn using TableOR11, b(2) not star nonum obslast label title("Table OR1_1: Double Hurdle Tobit Results for 2017 Survey Changes in Beliefs") addnotes("Notes:*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively; ^,^^,^^^: statistically different than corresponding Choir coefficient at .05, .01, and .001 levels, respectively. Higher coefficient values indicate more pro-environmental beliefs; when necessary, variables are reverse coded to accomplish this.") mtitles rtf replace
/*table needs reformatting*/

/*estimate models with interactions to see if choir and nonbeliever coefficients are statistically different
gen videonatc = video*(nature_pre <=2)
gen textnatc = text*(nature_pre<=2)
gen videolitc=video*(litter_pre<=2)
gen textlitc=text*(litter_pre<=2)
gen videoenc=video*(energy_pre<=2)
gen textenc=text*(energy_pre<=2)
gen videolandfc=video*(landfills_pre<=2)
gen textlandfc=text*(landfills_pre<=2)
*/
tobit nature_post_r nature_pre_r video videonatc text textnatc,nocon ul ll constraints(1)
testparm videonatc textnatc
tobit litter_post_r litter_pre_r video videolitc text textlitc,nocon ul ll constraints(2)
testparm videolitc textlitc
tobit energy_post_r energy_pre_r video videoenc text textenc,nocon ul ll constraints(3)
testparm videoenc textenc
tobit landfills_post_r landfills_pre_r video videolandfc text textlandfc, nocon ul ll constraints(4)
testparm videolandfc textlandfc

/*attitudes, sense of responsibility, and personal norms
good: continuous scale 1-5, higher means reducing, reusing, recycling is more good
obligation: continuous scale 1-5, higher means stronger obligation to reduce/reuse/recycle
guilty: continuous scale 1-5, lower means stronger feeling of guilt if they don't reduce/reuse/recycle. So reverse-code:
gen guilty_r = guilty * -1
gen guilty_pre_r = guilty_pre * -1
gen guilty_post_r = guilty_post * -1
*/

constraint 5 good_pre = 1
tobit good_post good_pre video text if good_pre >=3.5,nocon ul ll constraints(5)
eststo goodtc, title("Reducing waste is good") 
tobit good_post good_pre video text if good_pre <3.5,nocon ul ll constraints(5)
eststo goodtn, title("Reducing waste is good") 

constraint 6 obligation_pre=1
tobit obligation_post obligation_pre video text if obligation_pre >=3.5, nocon ul ll constraints(6)
eststo obligationtc, title ("Strong obligation to reduce waste")
tobit obligation_post obligation_pre video text if obligation_pre <3.5, nocon ul ll constraints(6)
eststo obligationtn, title ("Strong obligation to reduce waste") 

constraint 7 guilty_pre_r = 1
tobit guilty_post_r guilty_pre_r video text if guilty_pre_r >=-2.5,nocon ul ll constraints(7)
eststo guiltytc, title ("Stronger feeling of guilt") 
tobit guilty_post_r guilty_pre_r video text if guilty_pre_r < -2.5,nocon ul ll constraints(7)
eststo guiltytn, title("Stronger feeling of guilt") 

esttab goodtc goodtn obligationtc obligationtn guiltytc guiltytn using TableOR12, b(2) not star nonum obslast label title("Table OR1_2: Double Hurdle Tobit Results for 2017 Survey Changes in Attitudes, Sense of Responsibility, and Personal Norms") addnotes("Notes:*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively; ^,^^,^^^: statistically different than corresponding Choir coefficient at .05, .01, and .001 levels, respectively. Higher coefficient values indicate more pro-environmental beliefs; when necessary, variables are reverse coded to accomplish this.") mtitles rtf replace
/*table needs reformatting*/

/*estimate models with interactions to see if choir and nonbeliever coefficients are statistically different
gen videoobc=video*(obligation_pre>=3.5)
gen textobc=text*(obligation_pre>=3.5)
gen videogoodc=video*(good_pre>=3.5)
gen textgoodc=text*(good_pre>=3.5)
gen videoguiltyc=video*(guilty_pre<=2.5)
gen textguiltyc=text*(guilty_pre<=2.5)
gen videointc=video*(intended_pre>=3.5)
gen textintc=text*(intended_pre>=3.5)
*/

tobit good_post good_pre video videogoodc text textgoodc,nocon ul ll constraints(5)
testparm videogoodc textgoodc
tobit obligation_post obligation_pre video videoobc text textobc,nocon ul ll constraints(6)
testparm videoobc textobc
tobit guilty_post_r guilty_pre_r video videoguiltyc text textguiltyc,nocon ul ll constraints(7)
testparm videoguiltyc textguiltyc

/*intended variables: Likert 1-5, higher number means more likely to reduce/reuse/recycle
*/
constraint 8 intended_pre = 1
tobit intended_post intended_pre video text if intended_pre >=3.5,nocon ul ll constraints(8)
eststo intendedtc,title ("More reduce/reuse/recycle") 
tobit intended_post intended_pre video text if intended_pre <3.5,nocon ul ll constraints(8)
eststo intendedtn,title ("More reduce/reuse/recycle")

esttab intendedtc intendedtn using TableOR13, b(2) scalars(p_value) not star nonum obslast label title("Table OR1_3: Split Sample Results from 2017 survey Changes in Intended Behavior") addnotes("Notes:*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively; ^,^^,^^^: statistically different than corresponding Choir coefficient at .05, .01. and .001 levels, respectively. Higher coefficient values indicate more pro-environmental beliefs.") mtitles rtf replace
/*table needs reformatting*/

/*estimate models with interactions to see if choir and nonbeliever coefficients are statistically different
gen videointc=video*(intended_pre>=3.5)
gen textintc=text*(intended_pre>=3.5)
*/
tobit intended_post intended_pre video  videointc text textintc,nocon ul ll constraints(8)
testparm videointc textintc

/*change path as necessary*/
use "C:Preaching to the Choir\Stata files\Dataverse files\Data201516surveys.dta"
eststo clear

/*reminder of how choir and nonbeliever subsets are defined
gen yeslitter = .
replace yeslitter = 2 if q57_2 >=4
replace yeslitter=0 if q57_2 <4
gen yeslandfill = .
replace yeslandfill = 2 if q57_2 >=4
replace yeslandfill = 0 if q57_2 < 4
gen yesocean = .
replace yesocean=2 if q57_3 >=4
replace yesocean = 0 if q57_3 <4

gen yesindividual = q32 <= 2
replace yesindividual = . if q32 == .
gen yesresponsibility = q33 >= 4
replace yesresponsibility = . if q33 ==.
*/

/* q31_repeat and q31r are reverse coded:
gen q31r_repeat = q31_repeat * (-1)
gen q31r = q31 * -1 
*/

constraint 1 q31r = 1
tobit q31r_repeat q31r sawtext sawart sawphototext sawartonly if yesindividual == 1 , nocon constraints(1) ul ll
eststo q31tc, title ("Individual actions matter") 
tobit q31r_repeat q31r sawtext sawart sawphototext sawartonly if yesindividual == 0 , nocon constraints(1) ul ll
eststo q31tn, title ("Individual actions matter") 

constraint 2 q33_1 = 1
tobit q41_1 q33_1 sawtext sawart sawphototext sawartonly if yesresponsibility == 1 , nocon constraints(2) ul ll
eststo q33tc,title ("Personal responsibility") 
tobit q41_1 q33_1 sawtext sawart sawphototext sawartonly if yesresponsibility == 0 , nocon constraints(2) ul ll
eststo q33tn,title ("Personal responsibility")

constraint 3 q57_1 = 1
tobit q58_1 q57_1 sawtext sawart sawphototext sawartonly if yeslitter==1 , nocon constraints(3) ul ll
eststo q571tc,title ("Litter") 
tobit q58_1 q57_1 sawtext sawart sawphototext sawartonly if yeslitter==0 , nocon constraints(3) ul ll
eststo q571tn,title ("Litter") 

constraint 4 q57_2 = 1
tobit q58_2 q57_2 sawtext sawart sawphototext sawartonly if yeslandfill==1 , nocon constraints(4) ul ll
eststo q572tc,title ("Landfill pollution")
tobit q58_2 q57_2 sawtext sawart sawphototext sawartonly if yeslandfill==0 , nocon constraints(4) ul ll
eststo q572tn,title ("Landfill pollution")

constraint 5 q57_3 = 1
tobit q58_3 q57_3 sawtext sawart sawphototext sawartonly if yesocean==1 , nocon constraints(5) ul ll
eststo q573tc,title ("Ocean pollution") 
tobit q58_3 q57_3 sawtext sawart sawphototext sawartonly if yesocean==0 , nocon constraints(5) ul ll
eststo q573tn,title ("Ocean pollution") 

/*Tables for Tobits  some reformatting is needed*/

esttab q31tc q31tn q33tc q33tn using Table4AES, b(2) not star nonum compress label title("Table OR1_4: Double Hurdle Tobit Results for 2015-16 Surveys Changes in General Attitude and Beliefs") addnotes("*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "^,^^,^^^: statistically different than corresponding Choir coefficients at .05, .01, and .001 levels, respectively." "Higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this") mtitles rtf alignment(l) replace

esttab q571tc q571tn q572tc q572tn q573tc q573tn using Table5AES, b(2) not star nonum compress label title("Table OR1_5: Double Hurdle Tobit Results for 2015-16 Surveys Changes in Beliefs about Plastic Pollution") addnotes("*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "^,^^,^^^: statistically different than corresponding Choir coefficients at .05, .01, and .001 levels, respectively." "Higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this") mtitles rtf alignment(l) replace

/*Now estimate tobits for full sample with choir dummy and interactions in order to test whether nonbeliever coefficients are statistically larger than choir coefficients. Then add ^ notations to tables
*/
constraint 1 q31=1
/*gen sawtextc31 = sawtext*yesindividual
gen sawartc31 = sawart*yesindividual
gen sawphototextc31=sawphototext*yesindividual
gen sawartonlyc31=sawartonly*yesindividual*/
tobit q31_repeat q31 sawtext sawtextc31 sawart sawartc31 sawphototext sawphototextc31 sawartonly sawartonlyc31, nocon constraints(1) ul ll
testparm sawtextc31 sawartc31 sawphototextc31 sawartonlyc31

constraint 2 q33_1=1
/*gen sawtextc33 = sawtext*yesresponsibility
gen sawartc33=sawart*yesresponsibility
gen sawphototextc33=sawphototext*yesresponsibility
gen sawartonlyc33=sawartonly*yesresponsibility*/
tobit q41_1 q33_1 sawtext sawtextc33 sawart sawartc33 sawphototext sawphototextc33 sawartonly sawartonlyc33, nocon constraints(2) ul ll
testparm sawtextc33 sawartc33 sawphototextc33 sawartonlyc33

constraint 3 q57_1 = 1
/*gen sawtextc571 = sawtext*yeslitter
gen sawartc571=sawart*yeslitter
gen sawphototextc571=sawphototext*yeslitter
gen sawartonlyc571 = sawartonly*yeslitter*/
tobit q58_1 q57_1 sawtext sawtextc571 sawart sawartc571 sawphototext sawphototextc571 sawartonly sawartonlyc571, nocon constraints(3) ul ll
testparm sawtextc571 sawartc571 sawphototextc571 sawartonlyc571

constraint 4 q57_2 = 1
/*gen sawtextc572 = sawtext*yeslandfill
gen sawartc572=sawart*yeslandfill
gen sawphototextc572=sawphototext*yeslandfill
gen sawartonlyc572=sawartonly*yeslandfill*/
tobit q58_2 q57_2 sawtext sawtextc572 sawart sawartc572 sawphototext sawphototextc572 sawartonly sawartonlyc572, nocon constraints(4) ul ll
testparm sawtextc572 sawartc572 sawphototextc572 sawartonlyc572

constraint 5 q57_3 = 1
/*gen sawtextc573 = sawtext*yesocean
gen sawartc573=sawart*yesocean
gen sawphototextc573=sawphototext*yesocean
gen sawartonlyc573=sawartonly*yesocean*/
tobit q58_3 q57_3 sawtext sawtextc573 sawart sawartc573 sawphototext sawphototextc573 sawartonly sawartonlyc573, nocon constraints(5) ul ll
testparm sawtextc573 sawartc573 sawphototextc573 sawartonlyc573

/*change path as necessary*/
use "C:Preaching to the Choir\Stata files\Dataverse files\Data2020survey.dta"

eststo clear

/*reminder of how groups are defined
gen yeslitter = .
replace yeslitter = 1 if q57_1 >=4
replace yeslitter=0 if q57_1 <4
gen yeslandfill = .
replace yeslandfill = 1 if q57_2 >=4
replace yeslandfill = 0 if q57_2 < 4
gen yesocean = .
replace yesocean=1 if q57_3 >=4
replace yesocean = 0 if q57_3 <4

gen yesindividual = q31 <= 2
replace yesindividual = . if q31 == .
gen yesresponsibility = q33 >= 4
replace yesresponsibility = . if q33 ==.
*/

/*reminder of reverse coded q31 and q31_repeat
gen q31r = q31 * -1
gen q31_repeat_r = q31_repeat * -1
*/

constraint 1 q31r=1
constraint 2 q33_1=1
constraint 3 q57_1 = 1
constraint 4 q57_2 = 1
constraint 5 q57_3 = 1

tobit q31_repeat_r q31r sawtext sawart sawphototext if yesindividual == 1 , nocon constraints(1) ul ll
eststo q31tc, title ("Individual actions matter") 
tobit q31_repeat_r q31r sawtext sawart sawphototext if yesindividual == 0 , nocon constraints(1) ul ll
eststo q31tn, title ("Individual actions matter") 

tobit q41_1 q33_1 sawtext sawart sawphototext if yesresponsibility == 1 , nocon constraints(2) ul ll
eststo q33tc,title ("Personal responsibility") 
tobit q41_1 q33_1 sawtext sawart sawphototext if yesresponsibility == 0 , nocon constraints(2) ul ll
eststo q33tn,title ("Personal responsibility") 

tobit q58_1 q57_1 sawtext sawart sawphototext if yeslitter==1 , nocon constraints(3) ul ll
eststo q571tc,title ("Litter") 
tobit q58_1 q57_1 sawtext sawart sawphototext if yeslitter==0 , nocon constraints(3) ul ll
eststo q571tn,title ("Litter") 

tobit q58_2 q57_2 sawtext sawart sawphototext if yeslandfill==1 , nocon constraints(4) ul ll
eststo q572tc,title ("Landfill pollution") 
tobit q58_2 q57_2 sawtext sawart sawphototext if yeslandfill==0 , nocon constraints(4) ul ll
eststo q572tn,title ("Landfill pollution") 

tobit q58_3 q57_3 sawtext sawart sawphototext if yesocean==1 , nocon constraints(5) ul ll
eststo q573tc,title ("Ocean pollution") 
tobit q58_3 q57_3 sawtext sawart sawphototext if yesocean==0 , nocon constraints(5) ul ll
eststo q573tn,title ("Ocean pollution") 

esttab q31tc q31tn q33tc q33tn using TableOR16, b(2) not star nonum compress label title("Table OR1_6: Double Hurdle Tobit Results for 2020 Survey Changes in General Attitude and Beliefs") addnotes("*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "^,^^,^^^: statistically different than corresponding Choir coefficients at .05, .01, and .001 levels, respectively." "Higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this") mtitles rtf alignment(l) replace

esttab q571tc q571tn q572tc q572tn q573tc q573tn using TableOR17, b(2) not star nonum compress label title("Table OR1_7: Double Hurdle Tobit Results for 2020 Survey Changes in Beliefs about Plastic Pollution") addnotes("*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "^,^^,^^^: statistically different than corresponding Choir coefficients at .05, .01, and .001 levels, respectively." "Higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this") mtitles rtf alignment(l) replace

/*Now estimate tobits for full sample with choir dummy and interactions in order to test whether nonbeliever coefficients are statistically larger than choir coefficients.
*/
constraint 1 q31r=1
/*gen sawtextc31 = sawtext*yesindividual
gen sawartc31 = sawart*yesindividual
gen sawphototextc31=sawphototext*yesindividual
*/
tobit q31_repeat_r q31r sawtext sawtextc31 sawart sawartc31 sawphototext sawphototextc31, nocon constraints(1) ul ll
testparm sawtextc31 sawartc31 sawphototextc31

constraint 2 q33_1=1
/*gen sawtextc33 = sawtext*yesresponsibility
gen sawartc33=sawart*yesresponsibility
gen sawphototextc33=sawphototext*yesresponsibility
*/
tobit q41_1 q33_1 sawtext sawtextc33 sawart sawartc33 sawphototext sawphototextc33, nocon constraints(2) ul ll
testparm sawtextc33 sawartc33 sawphototextc33

constraint 3 q57_1 = 1
/*gen sawtextc571 = sawtext*yeslitter
gen sawartc571=sawart*yeslitter
gen sawphototextc571=sawphototext*yeslitter
*/
tobit q58_1 q57_1 sawtext sawtextc571 sawart sawartc571 sawphototext sawphototextc571, nocon constraints(3) ul ll
testparm sawtextc571 sawartc571 sawphototextc571

constraint 4 q57_2 = 1
/*gen sawtextc572 = sawtext*yeslandfill
gen sawartc572=sawart*yeslandfill
gen sawphototextc572=sawphototext*yeslandfill
*/
tobit q58_2 q57_2 sawtext sawtextc572 sawart sawartc572 sawphototext sawphototextc572, nocon constraints(4) ul ll
testparm sawtextc572 sawartc572 sawphototextc572

constraint 5 q57_3 = 1
/*gen sawtextc573 = sawtext*yesocean
gen sawartc573=sawart*yesocean
gen sawphototextc573=sawphototext*yesocean
*/
tobit q58_3 q57_3 sawtext sawtextc573 sawart sawartc573 sawphototext sawphototextc573, nocon constraints(5) ul ll
testparm sawtextc573 sawartc573 sawphototextc573


